<template>
  <div class="mode">
    <van-form @submit="onSubmit">
      <van-cell-group inset>
        <van-field
          v-model="forms.username"
          :label-width="0"
          placeholder="请选择出发地"
          :rules="[{ required: true, message: '请选择出发地' }]"
        />
        <van-field
          v-model="forms.password"
          :label-width="0"
          placeholder="请选择目的地"
          :rules="[{ required: true, message: '请选择目的地' }]"
        />
      </van-cell-group>
      <div style="margin: 16px;">
        <van-button round block type="primary" native-type="submit">
          提交
        </van-button>
      </div>
    </van-form>
  </div>
</template>

<script>
import { reactive, toRefs } from "vue";

export default {
  name: "carAirport",
  props: {
    type: String // 1：接机，2：送机
  },
  setup(props) {
    const pageData = reactive({
      forms: {}
    });
    const pageMethod = {
      onSubmit() {
        console.log(arguments);
      }
    };

    return {
      ...props,
      ...toRefs(pageData),
      ...pageMethod
    };
  }
};
</script>

<style scoped></style>
